import { request, config } from 'utils'
import * as commonService from "utils/services";

const { api } = config;
const { financialPaymentBill } = api;

export async function query(params = {}) {
  params.apiBaseUrl = `${financialPaymentBill}`;
  return commonService.commonQuery(params);
}

export async function detail(id) {
  const url = `${financialPaymentBill}/${id}/detail`;
  return request({ url: url, method: 'GET', data: {} })
}

export async function auditApprove(data) {
  const url = `${financialPaymentBill}/${data.paymentBillId}/approve`;
  return request({ url: url, method: 'POST', data: data.remark })
}

export async function auditDeny(data) {
  const url = `${financialPaymentBill}/${data.paymentBillId}/deny`;
  return request({ url: url, method: 'POST', data: data.remark })
}

export async function pay(data) {
  const url = `${financialPaymentBill}/${data.paymentBillId}/pay`;
  return request({ url: url, method: 'POST', data: data.paymentInfo })
}

export async function receipt(paymentBillId) {
  const url = `${financialPaymentBill}/${paymentBillId}/receipt`;
  return request({ url: url, method: 'POST', data: {} })
}
